import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button, Image} from '@tarojs/components'
import applySuccessImg from '../../images/stage/applySuccess.png'
import './publishSuccess.scss'

export default class Publishsuccess extends Component {

  config = {
    navigationBarTitleText: '首页'
  }

  handleBtnChooseProducts(){
    if(!this.$router.params.data){
      Taro.showToast({
        title: '注意，您未传递内容（发布的需求id）过来',
        icon: 'none',
        duration: 2000
      })
    }else{
      Taro.redirectTo({
        url:'/pages/chooseProduct/chooseProduct?id='+this.$router.params.data
      })
    }
  }

  render () {
    
    
    return (
      <View className='publishSuccess'>
        <View className='Result'>
          <Image mode="widthFix" src={applySuccessImg}></Image>
          <Text>申请成功</Text>
          <Button type='primary' onClick={this.handleBtnChooseProducts}>选择产品</Button>
        </View>
      </View>
    )
  }
} 
